<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>ComparatorUtils (Apache Commons Collections 4.0 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ComparatorUtils (Apache Commons Collections 4.0 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ComparatorUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/collections4/CollectionUtils.html" title="class in org.apache.commons.collections4"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/collections4/EnumerationUtils.html" title="class in org.apache.commons.collections4"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/collections4/ComparatorUtils.html" target="_top">Frames</a></li>
<li><a href="ComparatorUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.collections4</div>
<h2 title="Class ComparatorUtils" class="title">Class ComparatorUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.collections4.ComparatorUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">ComparatorUtils</span>
extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Provides convenient static utility methods for <Code>Comparator</Code>
 objects.
 <p>
 Most of the functionality in this class can also be found in the
 <code>comparators</code> package. This class merely provides a
 convenient central place if you have use for more than one class
 in the <code>comparators</code> subpackage.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>2.1</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: ComparatorUtils.java 1543971 2013-11-20 22:16:05Z tn $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#NATURAL_COMPARATOR">NATURAL_COMPARATOR</a></strong></code>
<div class="block">Comparator for natural sort order.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#booleanComparator(boolean)">booleanComparator</a></strong>(boolean&nbsp;trueFirst)</code>
<div class="block">Gets a Comparator that can sort Boolean objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;? super E&gt;&gt;&nbsp;<br><a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#chainedComparator(java.util.Collection)">chainedComparator</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&gt;&nbsp;comparators)</code>
<div class="block">Gets a comparator that compares using a collection of <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util"><code>Comparator</code></a>s,
 applied in (default iterator) sequence until one returns not equal or the
 collection is exhausted.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;? super E&gt;&gt;&nbsp;<br><a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#chainedComparator(java.util.Comparator...)">chainedComparator</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;...&nbsp;comparators)</code>
<div class="block">Gets a comparator that compares using an array of <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util"><code>Comparator</code></a>s, applied
 in sequence until one returns not equal or the array is exhausted.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;E</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#max(E, E, java.util.Comparator)">max</a></strong>(E&nbsp;o1,
   E&nbsp;o2,
   <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</code>
<div class="block">Returns the larger of the given objects according to the given
 comparator, returning the second object if the comparator
 returns equal.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;E</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#min(E, E, java.util.Comparator)">min</a></strong>(E&nbsp;o1,
   E&nbsp;o2,
   <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</code>
<div class="block">Returns the smaller of the given objects according to the given
 comparator, returning the second object if the comparator
 returns equal.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;? super E&gt;&gt;&nbsp;<br><a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#naturalComparator()">naturalComparator</a></strong>()</code>
<div class="block">Gets a comparator that uses the natural order of the objects.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#nullHighComparator(java.util.Comparator)">nullHighComparator</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</code>
<div class="block">Gets a Comparator that controls the comparison of <code>null</code> values.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#nullLowComparator(java.util.Comparator)">nullLowComparator</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</code>
<div class="block">Gets a Comparator that controls the comparison of <code>null</code> values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#reversedComparator(java.util.Comparator)">reversedComparator</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</code>
<div class="block">Gets a comparator that reverses the order of the given comparator.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;I,O&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;I&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ComparatorUtils.html#transformedComparator(java.util.Comparator, org.apache.commons.collections4.Transformer)">transformedComparator</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;O&gt;&nbsp;comparator,
                     <a href="../../../../org/apache/commons/collections4/Transformer.html" title="interface in org.apache.commons.collections4">Transformer</a>&lt;? super I,? extends O&gt;&nbsp;transformer)</code>
<div class="block">Gets a Comparator that passes transformed objects to the given comparator.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="NATURAL_COMPARATOR">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NATURAL_COMPARATOR</h4>
<pre>public static final&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a> NATURAL_COMPARATOR</pre>
<div class="block">Comparator for natural sort order.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/comparators/ComparableComparator.html#comparableComparator()"><code>ComparableComparator.comparableComparator()</code></a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="naturalComparator()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>naturalComparator</h4>
<pre>public static&nbsp;&lt;E extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;? super E&gt;&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;naturalComparator()</pre>
<div class="block">Gets a comparator that uses the natural order of the objects.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd>
<dt><span class="strong">Returns:</span></dt><dd>a comparator which uses natural order</dd></dl>
</li>
</ul>
<a name="chainedComparator(java.util.Comparator...)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chainedComparator</h4>
<pre>public static&nbsp;&lt;E extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;? super E&gt;&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;chainedComparator(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;...&nbsp;comparators)</pre>
<div class="block">Gets a comparator that compares using an array of <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util"><code>Comparator</code></a>s, applied
 in sequence until one returns not equal or the array is exhausted.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd><dt><span class="strong">Parameters:</span></dt><dd><code>comparators</code> - the comparators to use, not null or empty or containing nulls</dd>
<dt><span class="strong">Returns:</span></dt><dd>a <a href="../../../../org/apache/commons/collections4/comparators/ComparatorChain.html" title="class in org.apache.commons.collections4.comparators"><code>ComparatorChain</code></a> formed from the input comparators</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if comparators array is null or contains a null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/comparators/ComparatorChain.html" title="class in org.apache.commons.collections4.comparators"><code>ComparatorChain</code></a></dd></dl>
</li>
</ul>
<a name="chainedComparator(java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chainedComparator</h4>
<pre>public static&nbsp;&lt;E extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;? super E&gt;&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;chainedComparator(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&gt;&nbsp;comparators)</pre>
<div class="block">Gets a comparator that compares using a collection of <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util"><code>Comparator</code></a>s,
 applied in (default iterator) sequence until one returns not equal or the
 collection is exhausted.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd><dt><span class="strong">Parameters:</span></dt><dd><code>comparators</code> - the comparators to use, not null or empty or containing nulls</dd>
<dt><span class="strong">Returns:</span></dt><dd>a <a href="../../../../org/apache/commons/collections4/comparators/ComparatorChain.html" title="class in org.apache.commons.collections4.comparators"><code>ComparatorChain</code></a> formed from the input comparators</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if comparators collection is null or contains a null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the comparators collection contains the wrong object type</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/comparators/ComparatorChain.html" title="class in org.apache.commons.collections4.comparators"><code>ComparatorChain</code></a></dd></dl>
</li>
</ul>
<a name="reversedComparator(java.util.Comparator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reversedComparator</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;reversedComparator(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</pre>
<div class="block">Gets a comparator that reverses the order of the given comparator.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd><dt><span class="strong">Parameters:</span></dt><dd><code>comparator</code> - the comparator to reverse</dd>
<dt><span class="strong">Returns:</span></dt><dd>a comparator that reverses the order of the input comparator</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/comparators/ReverseComparator.html" title="class in org.apache.commons.collections4.comparators"><code>ReverseComparator</code></a></dd></dl>
</li>
</ul>
<a name="booleanComparator(boolean)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>booleanComparator</h4>
<pre>public static&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang">Boolean</a>&gt;&nbsp;booleanComparator(boolean&nbsp;trueFirst)</pre>
<div class="block">Gets a Comparator that can sort Boolean objects.
 <p>
 The parameter specifies whether true or false is sorted first.
 <p>
 The comparator throws NullPointerException if a null value is compared.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>trueFirst</code> - when <code>true</code>, sort
        <code>true</code> <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang"><code>Boolean</code></a>s before
        <code>false</code> <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang"><code>Boolean</code></a>s.</dd>
<dt><span class="strong">Returns:</span></dt><dd>a comparator that sorts booleans</dd></dl>
</li>
</ul>
<a name="nullLowComparator(java.util.Comparator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nullLowComparator</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;nullLowComparator(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</pre>
<div class="block">Gets a Comparator that controls the comparison of <code>null</code> values.
 <p>
 The returned comparator will consider a null value to be less than
 any nonnull value, and equal to any other null value.  Two nonnull
 values will be evaluated with the given comparator.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd><dt><span class="strong">Parameters:</span></dt><dd><code>comparator</code> - the comparator that wants to allow nulls</dd>
<dt><span class="strong">Returns:</span></dt><dd>a version of that comparator that allows nulls</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/comparators/NullComparator.html" title="class in org.apache.commons.collections4.comparators"><code>NullComparator</code></a></dd></dl>
</li>
</ul>
<a name="nullHighComparator(java.util.Comparator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nullHighComparator</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;nullHighComparator(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</pre>
<div class="block">Gets a Comparator that controls the comparison of <code>null</code> values.
 <p>
 The returned comparator will consider a null value to be greater than
 any nonnull value, and equal to any other null value.  Two nonnull
 values will be evaluated with the given comparator.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd><dt><span class="strong">Parameters:</span></dt><dd><code>comparator</code> - the comparator that wants to allow nulls</dd>
<dt><span class="strong">Returns:</span></dt><dd>a version of that comparator that allows nulls</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/comparators/NullComparator.html" title="class in org.apache.commons.collections4.comparators"><code>NullComparator</code></a></dd></dl>
</li>
</ul>
<a name="transformedComparator(java.util.Comparator, org.apache.commons.collections4.Transformer)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transformedComparator</h4>
<pre>public static&nbsp;&lt;I,O&gt;&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;I&gt;&nbsp;transformedComparator(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;O&gt;&nbsp;comparator,
                                        <a href="../../../../org/apache/commons/collections4/Transformer.html" title="interface in org.apache.commons.collections4">Transformer</a>&lt;? super I,? extends O&gt;&nbsp;transformer)</pre>
<div class="block">Gets a Comparator that passes transformed objects to the given comparator.
 <p>
 Objects passed to the returned comparator will first be transformed
 by the given transformer before they are compared by the given
 comparator.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>I</code> - the input object type of the transformed comparator</dd><dd><code>O</code> - the object type of the decorated comparator</dd><dt><span class="strong">Parameters:</span></dt><dd><code>comparator</code> - the sort order to use</dd><dd><code>transformer</code> - the transformer to use</dd>
<dt><span class="strong">Returns:</span></dt><dd>a comparator that transforms its input objects before comparing them</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/comparators/TransformingComparator.html" title="class in org.apache.commons.collections4.comparators"><code>TransformingComparator</code></a></dd></dl>
</li>
</ul>
<a name="min(java.lang.Object,java.lang.Object,java.util.Comparator)">
<!--   -->
</a><a name="min(E, E, java.util.Comparator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>min</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;E&nbsp;min(E&nbsp;o1,
        E&nbsp;o2,
        <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</pre>
<div class="block">Returns the smaller of the given objects according to the given
 comparator, returning the second object if the comparator
 returns equal.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd><dt><span class="strong">Parameters:</span></dt><dd><code>o1</code> - the first object to compare</dd><dd><code>o2</code> - the second object to compare</dd><dd><code>comparator</code> - the sort order to use</dd>
<dt><span class="strong">Returns:</span></dt><dd>the smaller of the two objects</dd></dl>
</li>
</ul>
<a name="max(java.lang.Object,java.lang.Object,java.util.Comparator)">
<!--   -->
</a><a name="max(E, E, java.util.Comparator)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>max</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;E&nbsp;max(E&nbsp;o1,
        E&nbsp;o2,
        <a href="http://download.oracle.com/javase/6/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;E&gt;&nbsp;comparator)</pre>
<div class="block">Returns the larger of the given objects according to the given
 comparator, returning the second object if the comparator
 returns equal.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the object type to compare</dd><dt><span class="strong">Parameters:</span></dt><dd><code>o1</code> - the first object to compare</dd><dd><code>o2</code> - the second object to compare</dd><dd><code>comparator</code> - the sort order to use</dd>
<dt><span class="strong">Returns:</span></dt><dd>the larger of the two objects</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ComparatorUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/collections4/CollectionUtils.html" title="class in org.apache.commons.collections4"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/collections4/EnumerationUtils.html" title="class in org.apache.commons.collections4"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/collections4/ComparatorUtils.html" target="_top">Frames</a></li>
<li><a href="ComparatorUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2001&#x2013;2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
